package business.misc;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Util {
	public static String DEFAULT = "default";
	public static String SUCCESS = "save_success";
	public static String FAIL = "save_fail";
	public static String EDIT = "edit";
	public static String ADD = "add";
	
	public static String str_format = "yyyy/MM/dd";
	private static SimpleDateFormat sdf      = new SimpleDateFormat(str_format);
	
	public static Calendar stringToCalendar(String str_date){
		Calendar cal_retVal = Calendar.getInstance();
		try {
			cal_retVal.setTime(sdf.parse(str_date));
		} catch (ParseException e) {
			cal_retVal = null;
		}
		return cal_retVal;
	}
	
	public static String dateToString(Date dte_fecha){
		String str_retVal = "";
		str_retVal = sdf.format(dte_fecha);
		return str_retVal;
	}
}